#pragma once
#include "Character.h"

class Door;
class RangedWeapon;

class Npc : public Character {
protected:
	int m_defaultLevel;
	void levelUp(bool verbose = true);
	void callMeleeAttack(Character* c, MeleeType type, Item* item = NULL, bool otherHandEmpty = false);
	std::string getExperienceLevel() const;
	void logCombat(Character* enemy, bool nothing = false, bool hit = true, bool blocked = false, int damage = 0, bool crit = false, bool flame = false, bool envy = false, bool lust = false);
	bool removeStatusEffect(StatusEffect effect);
	bool openDoor(Door* door);
	void giveExperience(int exp);
	void logReload(RangedWeapon* weapon, bool noAmmo = false) const;
public:
	Npc(NpcType type, bool hostile = true);
	Npc(std::ifstream& file);
	~Npc();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	void takeTurn();
	bool equip(EquipmentLocation location, Item* item, bool takeTurn = true);
	bool unequip(EquipmentLocation location);
	bool dealDamage(int damage);
	bool quaff(Potion* potion);
	void heal(int amount);
	bool poison(int damage);
	bool addStatusEffect(StatusEffect effect, int power);
	void logTrap(TrapType trap, bool hit = true, int damage = 0);
	void save(std::ofstream& file) const;
};
